package top.laoshuzi.designpatterns.base.behavior.command;

import java.util.LinkedList;
import java.util.List;

/**
 * 具体宏命令
 */
public class ConcreteMacroCommand implements MacroCommand {

    private List<Command> commandList = new LinkedList<>();

    @Override
    public void execute() {
        for (Command command : commandList) {
            command.execute();
        }
    }

    @Override
    public void add(Command command) {
        commandList.add(command);
    }

    @Override
    public void remove(Command command) {
        commandList.remove(command);
    }
}
